﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UIProformaListForm.aspx.cs"
 Inherits="UILGestion.VentaAdmin.Proforma.UIProformaListForm" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="lib" %>
<%@ Register src="UIProformaListGrid.ascx" tagname="UIProformaListGrid" tagprefix="uc3" %>
<%@ Register src="../../Control/menuCtrl.ascx" tagname="menuCtrl" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Lista de Proformas</title>
    <link href="../../resources/css/main.css" rel="stylesheet" type="text/css" />
    
    <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../../estilos/_common/styles/theme.css" />
   <script src="../../Scripts/jquery-1.5.2.min.js" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function () {
           $(document).bind('contextmenu', function (e) {
               return false;
           });
       });
</script>

   <script type="text/javascript">


       function goPageExportar() {


           var idProyecto = document.getElementById("idProyecto").value;
           var docCliente = document.getElementById("docclienteTXT").value;
           var cliente = document.getElementById("nombreClienteTXT").value;
           var ui = document.getElementById("UITXT").value;
           var numero = document.getElementById("numDocumentoTXT").value;
          

           window.open('../../Rpt/ExportExcelForm.aspx?type=PROFORMA&idProyecto=' + idProyecto.toString() +
                                                '&clienteStr=' + docCliente.toString() +
                                                '&idEtapa=' + cliente.toString() +
                                                '&uiStr=' + ui.toString() +
                                                '&numero=' + numero.toString());



       }
       function goPageNuevo() {


           var idProyecto = document.getElementById("idProyecto").value;

           window.open('OrdenVentaEditForm.aspx?type=A&idProyecto=' + idProyecto.toString());

       }
</script>

    <style type="text/css">
        .style1
        {
            height: 22px;
        }
    </style>
</head>
<body >
   <form id="form1" runat="server">
     <input id="idEtapa" type="hidden" runat="server" name="idObra"  />
     <input id="idProyecto" type="hidden" runat="server" />
    <uc1:menuCtrl ID="menuCtrl1" runat="server" />
    
    <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server"
         EnablePartialRendering="true"
          EnableScriptGlobalization="true">
    </asp:ToolkitScriptManager>
    

 
 <asp:Panel ID="Panel2" runat="server"
  CssClass="Heading secTitle AreaHeading ms-crm-List-Header">
  <asp:Label ID="Label2" runat="server" Text="LISTA DE PROFORMAS" 
         style="font-size: large; color: #960818"></asp:Label>
 </asp:Panel>
  <asp:Panel ID="PanelButtom" runat="server"
  BackColor="white">
  
    <table  width="100%">
          <tr>
              <td Width="800px">
              <asp:Panel ID="PanelwButtom" runat="server"   BackColor="white"  GroupingText="Filtros de busqueda">

              <table cellspacing="1" width="100%" >
          <tr>
          <td align="right" class="style1" width="150px">
                 Doc. Cliente:</td>
                <td class="style1" width="100px"> 
                   
                    
                   
                   
                    <asp:TextBox ID="docclienteTXT" runat="server" Width="100px"></asp:TextBox>
              </td>
             <td width="100px" align="right">Nombre Cliente:</td>
              <td colspan="3">
                  <asp:TextBox ID="nombreClienteTXT" runat="server" Width="300px"></asp:TextBox>
              </td>
              <td>
                  &nbsp;</td>
 </tr>
                  <tr >
                      <td align="right" width="150px" class="style1">
                          Unidad Inmobiliaria:</td>
                      <td width="100px" class="style1">
                          <asp:TextBox ID="UITXT" runat="server" Width="100px"></asp:TextBox>
                      </td>
                      <td align="right" width="100px" class="style1">
                          </td>
                      <td align="right" width="80px" colspan="2">
                          <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                              <ProgressTemplate>
                                  <img src="../../App_Resources/images/loader-life.gif" alt="Loading Data" />
                              </ProgressTemplate>
                          </asp:UpdateProgress>
                          </td>
                      <td class="style1">
                          </td>
                      <td class="style1">
                          &nbsp;</td>
                  </tr>
                  <tr>
                      <td align="right" width="150px">
                          Num. Proforma:</td>
                      <td width="100px">
                          <asp:TextBox ID="numDocumentoTXT" runat="server" Width="100px"></asp:TextBox>
                      </td>
                      <td align="right" width="100px">
                          &nbsp;</td>
                      <td align="right" width="80px">
                          &nbsp;</td>
                      <td align="right">
                          <asp:Button ID="BuscarBtn" runat="server" CssClass="ms-crm-List-Header" 
                              onclick="button" Text="Actualizar" Width="80px" />
                      </td>
                      <td align="right" >
                          <asp:Button ID="nuevaVentaButton" runat="server" CssClass="ms-crm-List-Header" 
                              onclick="button" Text="Nuevo Proforma" />
                      </td>
                      <td align="left" width="150px">
                          <asp:Button ID="exportarBTN" runat="server" CssClass="ms-crm-List-Header" 
                              onclick="button" Text="Exportar Excel"  
                              OnClientClick="goPageExportar()"   />
                      </td>
                  </tr>
 </table>
 </asp:Panel>
 </td>
      <td>
                  &nbsp;</td>
          </tr>
      </table>

       
   
    <br />


     <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
     <ContentTemplate>
         
            <uc3:UIProformaListGrid ID="proyectoListGrid1" runat="server"  DataSourceID="proformaStrListODS" />

            <asp:ObjectDataSource ID="proformaStrListODS"  runat="server"
             EnablePaging="True"
              SelectCountMethod="Count" 
              SortParameterName="sortExpression"
             SelectMethod="Execute" 
             typeName="BOL.Ventas.GetProformaList" >
               <SelectParameters>
                <asp:querystringparameter Name="idProyecto" querystringfield="idProyecto" Type="Int32" />
                <asp:ControlParameter Name="docCliente" Type="String" ControlID="docclienteTXT"/>
                <asp:ControlParameter Name="clienteStr" Type="String" ControlID="nombreClienteTXT"/>
                <asp:ControlParameter Name="uiStr" Type="String" ControlID="UITXT"/>
                <asp:ControlParameter Name="numDocumento" Type="String" ControlID="numDocumentoTXT"/>
                
                


                <asp:Parameter Name="startRowIndex" Type="Int32" />
                <asp:Parameter Name="maximumRows" Type="Int32" />
                <asp:Parameter Name="sortExpression" Type="String" />

                </SelectParameters>
               </asp:ObjectDataSource>
       
           
       
       </ContentTemplate>
        <Triggers>
       <asp:AsyncPostBackTrigger ControlID="BuscarBtn" /> 
           </Triggers>
       
     </asp:UpdatePanel>
       </asp:Panel>
    </form>

</body>
</html>
